<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <!-- 基础信息 -->
    <meta charset="utf-8">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="force-rendering" content="webkit" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#424242" />
    <title>{$website.title}</title>
    <meta name="keywords" content="{$website.keywords ?? ''}">
    <meta name="description" content="{$website.description ?? ''}">
    <link rel="shortcut icon" href="{$website.logo ?? ''}">
    <link rel="icon" href="{$website.favicon ?? ''}" type="image/x-icon">
    <!-- jQuery -->
    <script src="/home/default/js/jquery.min.js"></script>
    <!-- HarmonyOS Sans -->
    <!-- 本站 CDN 已开启防盗链，非本站域名不可访问，请更改链接为下方内容，否则自定义字体将失效 -->
    <!-- https://s1.hdslb.com/bfs/static/jinkela/long/font/regular.css -->
    <link rel="stylesheet" href="https://s1.hdslb.com/bfs/static/jinkela/long/font/regular.css" />
    <!-- 引入样式 -->
    <link rel="stylesheet" type="text/css" href="/home/default/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/home/default/css/style.css">
    <link rel="stylesheet" type="text/css" href="/home/default/css/mobile.css">
    <link rel="stylesheet" type="text/css" href="/home/default/css/loading.css">
    <link rel="stylesheet" type="text/css" href="/home/default/css/animation.css">
    <link rel="apple-touch-icon" href="/home/default/img/icon/apple-touch-icon.png">
    <!-- Izitoast -->
    <link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-y/izitoast/1.4.0/css/iziToast.min.css">
    <script type="text/javascript"
            src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-y/izitoast/1.4.0/js/iziToast.min.js">
    </script>
    <!-- FontAwesome -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.1.2/css/all.min.css">
    <!-- Aplayer -->
    <link rel="stylesheet" href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-y/aplayer/1.10.1/APlayer.min.css"
          crossorigin="anonymous" referrerpolicy="no-referrer" />
    <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-y/aplayer/1.10.1/APlayer.min.js" crossorigin="anonymous"
            referrerpolicy="no-referrer"></script>
    <!-- <script src="./js/Meting.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script> -->
    <!-- IE Out -->
    <script>
        if ( /*@cc_on!@*/ false || (!!window.MSInputMethodContext && !!document.documentMode)) window.location.href =
            "/upgrade-your-browser/index.html?referrer=" + encodeURIComponent(window.location.href);
    </script>
</head>

<body>
<!--加载动画-->
<div id="loading-box">
    <div class="loading-left-bg"></div>
    <div class="loading-right-bg"></div>
    <div class="spinner-box">
        <div class="loader">
            <div class="inner one"></div>
            <div class="inner two"></div>
            <div class="inner three"></div>
        </div>
        <div class="loading-word">
            <p class="loading-title" id="loading-title">{$website.title}</p>
            <span id="loading-text">加载中</span>
        </div>
    </div>
</div>
<section id="section" class="section">
    <!-- 背景图片 -->
    <div class="bg-all">
        <img id="bg" onerror="this.classList.add('error');"></img>
        <div class="cover"></div>
    </div>
    <!-- 鼠标指针 -->
    <div id="g-pointer-1"></div>
    <div id="g-pointer-2"></div>
    <!-- 主体内容 -->
    <main id="main" class="main">
        <div class="container" id="container">
            <div class="row" id="row">
                <div class="col left">
                    <!--基本信息-->
                    <div class="main-left">
                        <!--Logo-->
                        <div class="main-img">
                            <img id="logo-img" src="{$website.logo ?? ''}" alt="img">
                            <div class="img-title">
<!--                                <span class="img-title-big" id="logo-text-1">{$website.title}</span>-->
                                <span class="img-text" id="logo-text-2">{$website.title}</span>
                            </div>
                        </div>
                        <!--介绍信息-->
                        <div class="message cards" id="switchmore">
                            <div class="des" id="des">
                                <i class="fa-solid fa-quote-left"></i>
                                <div class="des-title"><span id="change"><?php echo $config['config'][1]['config'][0]['value'];?></span><br /><span
                                        id="change1"><?php echo $config['config'][1]['config'][1]['value'];?></span></div>
                                <i class="fa-solid fa-quote-right"></i>
                            </div>
                        </div>
                        <!--社交链接-->
                        <div class="social" id="social">
<!--                            <a href="https://github.com/imsyy" class="link" id="github" style="margin-left: 4px"-->
<!--                               target="_blank">-->
<!--                                <i class="fa-brands fa-github"></i>-->
<!--                            </a>-->
                            <a href="https://wpa.qq.com/msgrd?v=3&uin={$website.qq ?? ''}&site=qq&menu=yes" class="link"
                               id="qq" target="_blank">
                                <i class="fa-brands fa-qq"></i>
                            </a>
                            <a href="mailto:{$website.mail ?? ''}" class="link" id="email">
                                <i class="fa-solid fa-envelope"></i>
                            </a>
<!--                            <a href="https://space.bilibili.com/" class="link" id="bilibili"-->
<!--                               target="_blank">-->
<!--                                <i class="fa-brands fa-bilibili"></i>-->
<!--                            </a>-->
<!--                            <a href="http://shuanq.cn" class="link" id="telegram" target="_blank">-->
<!--                                <i class="fa-brands fa-telegram"></i>-->
<!--                            </a>-->
                            <a id="link-text">通过这里联系我</a>
                        </div>
                    </div>
                </div>
                <!--第二屏 Logo-->
                <div class="logo cards" style="display: none" id="changemore">
                    <a class="logo-text" id="logo-text-small">logo</a>
                </div>
                <div class="col right">
                    <div class="main-right">
                        <!--功能区-->
                        <div class="row rightone" id="rightone">
                            <div class="col hitokotos">
                                <!--一言-->
                                <div class="hitokoto cards" id="hitokoto">
                                    <!--切换音乐-->
                                    <div class="open-music fixed-top" id="open-music">
                                        <i class="fa-solid fa-compact-disc"></i>
                                        <span>&nbsp;打开音乐播放器</span>
                                    </div>
                                    <!--切换音乐结束-->
                                    <div class="hitokoto-all">
                                        <div class="hitokoto-text"><span id="hitokoto_text">每一个人都应该明确自己的方向和位置</span>
                                        </div>
                                        <div class="hitokoto-from">-「&nbsp;<span id="from_text">無名</span>&nbsp;」
                                        </div>
                                    </div>
                                </div>
                                <!--音乐-->
                                <div class="music" id="music">
                                    <div class="music-all">
                                        <div class="music-button">
                                            <div id="music-open">音乐列表</div>
                                            <div id="music-close">回到一言</div>
                                        </div>
                                        <div class="music-control">
                                            <i class="fa-solid fa-backward-step" id="last"></i>
                                            <div id="play">
                                                <i class="fa-solid fa-play"></i>
                                            </div>
                                            <i class="fa-solid fa-forward-step" id="next"></i>
                                        </div>
                                        <div class="music-menu">
                                            <div class="music-text">
                                                <span id="music-name">未播放音乐</span>
                                            </div>
                                            <div class="music-volume" style="display: none;">
                                                <div id="volume-ico">
                                                    <i class="fa-solid fa-volume-low"></i>
                                                </div>
                                                <input type="range" min="0" max="1" step="0.01" id="volume">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col times">
                                <!--时间-->
                                <div class="time cards" id="upWeather">
                                    <div class="timeshow" id="time">
                                        2000&nbsp;年&nbsp;0&nbsp;月&nbsp;00&nbsp;日&nbsp;<span
                                            class="weekday">星期一</span><br><span class="time-text">00:00:00</span>
                                    </div>
                                    <div class="weather">
                                        <span id="city_text">{$website.title}</span>&nbsp;
<!--                                        <span id="wea_text">加载失败</span>&nbsp;-->
<!--                                        <span id="tem_text"></span>-->
<!--                                        <span id="win_text">次数</span>-->
<!--                                        <span id="win_speed">超限</span>-->
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--分隔线-->
                        <div class="line">
                            <i class="fa-solid fa-link"></i>
                            <span class="line-text"><?php echo $config['config'][2]['config'][0]['value'];?></span>
                        </div>
                        <!--网站链接-->
                        <div class="link">

                            <?php
                            $groupList=array_chunk($config['config'][2]['config'][1]['value'],3);
                            foreach($groupList as $group_index=>$group){
                                echo '<div class="row" '.($group_index>0?'style="margin-top: 1.5rem;"':'').'>';
                                            if(isset($group[0])){
                                            echo '
                                            <div class="col">
                                                <a id="link-url-1" href="'.$group[0]['url'].'">
                                                    <div class="link-card cards">
                                                        <i id="link-icon-1" class="fa-solid fa-compass"></i>
                                                        <span class="link-name" id="link-name-1">'.$group[0]['name'].'</span>
                                                    </div>
                                                </a>
                                            </div>
                                            '; }
                                            if(isset($group[1])){
                                            echo '
                                            <div class="col 2">
                                                <a id="link-url-2" href="'.$group[1]['url'].'" target="_blank">
                                                    <div class="link-card cards">
                                                        <i id="link-icon-2" class="fa-solid fa-compass"></i>
                                                        <span class="link-name" id="link-name-2">'.$group[1]['name'].'</span>
                                                    </div>
                                                </a>
                                            </div>
                                            '; }
                                            if(isset($group[2])){
                                            echo '
                                            <div class="col">
                                                <a id="link-url-3" href="'.$group[2]['url'].'" target="_blank">
                                                    <div class="link-card cards">
                                                        <i id="link-icon-3" class="fa-solid fa-compass"></i>
                                                        <span class="link-name" id="link-name-3">'.$group[2]['name'].'</span>
                                                    </div>
                                                </a>
                                            </div>
                                            '; }
                                echo'</div>';
                            }
                            ?>
                        </div>
                    </div>
                </div>
            </div>
            <!--展开菜单按钮-->
            <div class="menu" id="switchmenu">
                <a class="munu-button cards" id="menu">
                    <i class="fa-solid fa-bars"></i>
                </a>
            </div>
            <!--更多内容-->
            <div class="more" id="more">
                <!--关闭按钮-->
                <div class="close fixed-top" id="close">
                    <i class="fa-solid fa-circle-xmark"></i>
                </div>
                <div class="line" style="margin-top: 1rem;">
                    <i class="fa-solid fa-angle-left"></i>
                    <span class="line-text">时间胶囊</span>
                    <i class="fa-solid fa-angle-right"></i>
                </div>
                <div class="date" id="date">
                    <div class="item" id="dayProgress">
                        <div class="date-text" style="margin-top: 0rem;">今日已经度过了&nbsp;<span></span>&nbsp;小时</div>
                        <div class="progress">
                            <div class="progress-bar"></div>
                        </div>
                    </div>
                    <div class="item" id="weekProgress">
                        <div class="date-text">本周已经度过了&nbsp;<span></span>&nbsp;天</div>
                        <div class="progress">
                            <div class="progress-bar"></div>
                        </div>
                    </div>
                    <div class="item" id="monthProgress">
                        <div class="date-text">本月已经度过了&nbsp;<span></span>&nbsp;天</div>
                        <div class="progress">
                            <div class="progress-bar"></div>
                        </div>
                    </div>
                    <div class="item" id="yearProgress">
                        <div class="date-text">今年已经度过了&nbsp;<span></span>&nbsp;个月</div>
                        <div class="progress">
                            <div class="progress-bar"></div>
                        </div>
                    </div>
                </div>
<!--                <div class="line">-->
<!--                    <i class="fa-solid fa-angle-left"></i>-->
<!--                    <span class="line-text">杂七杂八</span>-->
<!--                    <i class="fa-solid fa-angle-right"></i>-->
<!--                </div>-->
<!--                &lt;!&ndash;网站链接&ndash;&gt;-->
<!--                <div class="row">-->
<!--                    <div class="col">-->
<!--                        <a href="https://status.imsyy.top/" target="_blank">-->
<!--                            <div class="link-card cards">-->
<!--                                <span class="link-name">站点监测</span>-->
<!--                            </div>-->
<!--                        </a>-->
<!--                    </div>-->
<!--                    <div class="col 2">-->
<!--                        <a href="https://player.imsyy.top/" target="_blank">-->
<!--                            <div class="link-card cards">-->
<!--                                <span class="link-name">播放器</span>-->
<!--                            </div>-->
<!--                        </a>-->
<!--                    </div>-->
<!--                    <div class="col">-->
<!--                        <a href="https://write.imsyy.top/" target="_blank">-->
<!--                            <div class="link-card cards">-->
<!--                                <span class="link-name">编辑器</span>-->
<!--                            </div>-->
<!--                        </a>-->
<!--                    </div>-->
<!--                </div>-->
<!--                <div class="row" style="margin-top: 1.5rem;">-->
<!--                    <div class="col">-->
<!--                        <a href="https://photo.imsyy.top/" target="_blank">-->
<!--                            <div class="link-card cards">-->
<!--                                <span class="link-name">时光相册</span>-->
<!--                            </div>-->
<!--                        </a>-->
<!--                    </div>-->
<!--                    <div class="col 2">-->
<!--                        <a href="https://share.imsyy.top/" target="_blank">-->
<!--                            <div class="link-card cards">-->
<!--                                <span class="link-name">文件库</span>-->
<!--                            </div>-->
<!--                        </a>-->
<!--                    </div>-->
<!--                    <div class="col">-->
<!--                        <a id="openmore">-->
<!--                            <div class="link-card cards">-->
<!--                                <span class="link-name">更多</span>-->
<!--                            </div>-->
<!--                        </a>-->
<!--                    </div>-->
<!--                </div>-->
            </div>
            <!--更多页面-->
            <div class="box" id="box" style="display: none">
                <div class="box-wrapper">
                    <!--关闭按钮-->
                    <div class="closebox fixed-top" id="closemore">
                        <i class="fa-solid fa-circle-xmark"></i>
                    </div>
                    <!--左侧内容-->
                    <div class="box-left">
                        <div class="img-title">
<!--                            <span class="img-title-big" id="logo-title-other">{$website.title}</span>-->
                            <span class="img-text" id="logo-title-other-small">{$website.title}</span><br />
<!--                            <span class="img-text">&nbsp;v&nbsp;3.3</span>-->
<!--                            <a href="https://github.com/imsyy/home" target="_blank">-->
<!--                                <i class="fa-brands fa-github"></i>-->
<!--                            </a>-->
                        </div>
                        <!--更多内容-->
                        <div class="accordion" id="accordion">
                            <div class="accordion-item">
                                <h2 class="accordion-header" id="headingOne">
                                    <button class="accordion-button" type="button" data-bs-toggle="collapse"
                                            data-bs-target="#collapseOne" aria-expanded="true"
                                            aria-controls="collapseOne">
                                        壁纸设置
                                    </button>
                                </h2>
                                <div id="collapseOne" class="accordion-collapse collapse show"
                                     aria-labelledby="headingOne" data-bs-parent="#accordion">
                                    <div class="accordion-body">
                                        <div class="set">
                                            <div class="wallpaper" id="wallpaper">
                                                <div class="form-radio">
                                                    <input type="radio" class="set-wallpaper" style="display: none;"
                                                           id="radio1" value="1" name="wallpaper-type">
                                                    <label for="radio1">默认壁纸</label>
                                                </div>
                                                <div class="form-radio">
                                                    <input type="radio" class="set-wallpaper" style="display: none;"
                                                           id="radio2" value="2" name="wallpaper-type">
                                                    <label for="radio2" id="wallpaper_text1">每日一图</label>
                                                </div>
                                                <div class="form-radio">
                                                    <input type="radio" class="set-wallpaper" style="display: none;"
                                                           id="radio3" value="3" name="wallpaper-type">
                                                    <label for="radio3" id="wallpaper_text2">随机风景</label>
                                                </div>
                                                <div class="form-radio">
                                                    <input type="radio" class="set-wallpaper" style="display: none;"
                                                           id="radio4" value="4" name="wallpaper-type">
                                                    <label for="radio4" id="wallpaper_text3">随机动漫</label>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--更新日志-->
                            <div class="accordion-item">
                                <h2 class="accordion-header" id="headingTwo">
                                    <button class="accordion-button collapsed" type="button"
                                            data-bs-toggle="collapse" data-bs-target="#collapseTwo"
                                            aria-expanded="false" aria-controls="collapseTwo">
                                        更新日志
                                    </button>
                                </h2>
                                <div id="collapseTwo" class="accordion-collapse collapse"
                                     aria-labelledby="headingTwo" data-bs-parent="#accordion">
                                    <div class="accordion-body">
                                        <div class="upnote">
                                                <span class="uptext">
                                                    <i class="fa-solid fa-circle-plus"></i>&nbsp;音乐歌单支持快速自定义
                                                </span>
                                            <span class="uptext">
                                                    <i class="fa-solid fa-circle-plus"></i>&nbsp;壁纸支持个性化设置
                                                </span>
                                            <span class="uptext">
                                                    <i class="fa-solid fa-circle-plus"></i>&nbsp;音乐播放器支持音量控制
                                                </span>
                                            <span class="uptext">
                                                    <i class="fa-solid fa-screwdriver-wrench"></i>&nbsp;修复天气 API
                                                </span>
                                            <span class="uptext">
                                                    <i class="fa-solid fa-screwdriver-wrench"></i>&nbsp;时光胶囊显示错误
                                                </span>
                                            <span class="uptext">
                                                    <i class="fa-solid fa-screwdriver-wrench"></i>&nbsp;移动端动画及细节
                                                </span>
                                            <span class="uptext">
                                                    <i class="fa-solid fa-screwdriver-wrench"></i>&nbsp;图标更换为 Font
                                                    Awesome</span>
                                            <span class="uptext">
                                                    <i class="fa-solid fa-rotate-left"></i>
                                                    <a href="/home/default/old/" style="color:#efefef">返回旧版站点</a>
                                                </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--Aplayer-->
                    <div class="box-right">
                        <div id="aplayer">
                            <span>音乐播放器加载失败</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <!-- 版权信息 -->
    <footer id="footer" class="fixed-bottom footer">
        <div class="power">
                <span id="power">Copyright&nbsp;&copy;
                    <script>
                        document.write((new Date()).getFullYear());
                    </script>
                    <a href="#" id="power-text">{$website.title}</a>
                </span>
            <!-- 站点备案 -->
            <a href="https://beian.miit.gov.cn" id="beian" target="_blank">&nbsp;备案号:{$website.filing_number ?? ''}</a>
        </div>
        <!-- 歌词显示 -->
        <div id="lrc"></div>
    </footer>
</section>

<!-- noscript -->
<noscript>
    <div class="noscript fixed-top">请开启 JavaScript</div>
</noscript>
<!-- JS -->
<script type="text/javascript" src="/home/default/js/set.js"></script>
<script type="text/javascript" src="/home/default/js/time.js"></script>
<script type="text/javascript" src="/home/default/js/js.cookie.js"></script>
<script type="text/javascript" src="/home/default/js/bootstrap.min.js">
</script>

<script>
    /*
    作者: imsyy
    主页：https://www.imsyy.top/
    GitHub：https://github.com/imsyy/home
    版权所有，请勿删除
    */

    //弹窗样式
    iziToast.settings({
        timeout: 10000,
        progressBar: false,
        close: false,
        closeOnEscape: true,
        position: 'topCenter',
        transitionIn: 'bounceInDown',
        transitionOut: 'flipOutX',
        displayMode: 'replace',
        layout: '1',
        backgroundColor: '#00000040',
        titleColor: '#efefef',
        messageColor: '#efefef',
        icon: 'Fontawesome',
        iconColor: '#efefef',
    });

    /* 鼠标样式 */
    const body = document.querySelector("body");
    const element = document.getElementById("g-pointer-1");
    const element2 = document.getElementById("g-pointer-2");
    const halfAlementWidth = element.offsetWidth / 2;
    const halfAlementWidth2 = element2.offsetWidth / 2;

    function setPosition(x, y) {
        element2.style.transform = `translate(${x - halfAlementWidth2 + 1}px, ${y - halfAlementWidth2 + 1}px)`;
    }

    body.addEventListener('mousemove', (e) => {
        window.requestAnimationFrame(function () {
            setPosition(e.clientX, e.clientY);
        });
    });



    //加载完成后执行
    window.addEventListener('load', function () {

        //载入动画
        $('#loading-box').attr('class', 'loaded');
        $('#bg').css("cssText", "transform: scale(1);filter: blur(0px);transition: ease 1.5s;");
        $('.cover').css("cssText", "opacity: 1;transition: ease 1.5s;");
        $('#section').css("cssText", "transform: scale(1) !important;opacity: 1 !important;filter: blur(0px) !important");

        //用户欢迎
        setTimeout(function () {
            iziToast.show({
                timeout: 2500,
                icon: false,
                title: hello,
                message: "<?php echo $config['config'][0]['config'][0]['value'];?>"
            });
        }, 800);

        //延迟加载音乐播放器
        // let element = document.createElement("script");
        // element.src = "/home/default/js/music.js";
        // document.body.appendChild(element);

        //中文字体缓加载-此处写入字体源文件 （暂时弃用）
        //先行加载简体中文子集，后续补全字集
        //由于压缩过后的中文字体仍旧过大，可转移至对象存储或 CDN 加载
        // const font = new FontFace(
        //     "MiSans",
        //     "url(" + "./font/MiSans-Regular.woff2" + ")"
        // );
        // document.fonts.add(font);

        //移动端去除鼠标样式
        if (Boolean(window.navigator.userAgent.match(/AppWebKit.*Mobile.*/))) {
            $('#g-pointer-2').css("display", "none");
        }

    }, false)

    setTimeout(function () {
        $('#loading-text').html("字体及文件加载可能需要一定时间")
    }, 3000);

    // 新春灯笼 （ 需要时可取消注释 ）
    // new_element=document.createElement("link");
    // new_element.setAttribute("rel","stylesheet");
    // new_element.setAttribute("type","text/css");
    // new_element.setAttribute("href","./css/lantern.css");
    // document.body.appendChild(new_element);

    // new_element=document.createElement("script");
    // new_element.setAttribute("type","text/javascript");
    // new_element.setAttribute("src","./js/lantern.js");
    // document.body.appendChild(new_element);

    //获取一言
    // {
    //     "id":1315,
    //     "uuid":"8ac3fca5-8d66-4635-a7ab-4c4b9c82d85d",
    //     "hitokoto":"选择最难的路走暗夜里看成群的星星涌来。",
    //     "type":"f",
    //     "from":"网络",
    //     "from_who":null,
    //     "creator":"简夜",
    //     "creator_uid":897,
    //     "reviewer":0,
    //     "commit_from":"web",
    //     "created_at":"1512708852",
    //     "length":19
    // }
    fetch('https://v1.hitokoto.cn?max_length=24')
        .then(response => response.json())
        .then(data => {
            $('#hitokoto_text').html(data.hitokoto)
            $('#from_text').html(data.from)
        })
        .catch(console.error)

    let times = 0;
    $('#hitokoto').click(function () {
        if (times == 0) {
            times = 1;
            let index = setInterval(function () {
                times--;
                if (times == 0) {
                    clearInterval(index);
                }
            }, 1000);
            fetch('https://v1.hitokoto.cn?max_length=24')
                .then(response => response.json())
                .then(data => {
                    $('#hitokoto_text').html(data.hitokoto)
                    $('#from_text').html(data.from)
                })
                .catch(console.error)
        } else {
            iziToast.show({
                timeout: 1000,
                icon: "fa-solid fa-circle-exclamation",
                message: '你点太快了吧'
            });
        }
    });

    //获取天气
    //请前往 https://www.mxnzp.com/doc/list 申请 app_id 和 app_secret
    //请前往 https://dev.qweather.com/ 申请 key
    const add_id = "wrknltonr0foslhs"; // app_id
    const app_secret = "Nlh1c0F6d0ZDU2pDR0J3YVBVbkhudz09"; // app_secret
    const key = "433f0c48615a48dfaf2f2b2444297e79" // key
    function getWeather() {
        fetch("https://www.mxnzp.com/api/ip/self?app_id=" + add_id + "&app_secret=" + app_secret)
            .then(response => response.json())
            .then(data => {
                let str = data.data.city
                let city = str.replace(/市/g, '')
                $('#city_text').html(city);
                fetch("https://geoapi.qweather.com/v2/city/lookup?location=" + city + "&number=1&key=" + key)
                    .then(response => response.json())
                    .then(location => {
                        let id = location.location[0].id
                        fetch("https://devapi.qweather.com/v7/weather/now?location=" + id + "&key=" + key)
                            .then(response => response.json())
                            .then(weather => {
                                $('#wea_text').html(weather.now.text)
                                $('#tem_text').html(weather.now.temp + "°C&nbsp;")
                                $('#win_text').html(weather.now.windDir)
                                $('#win_speed').html(weather.now.windScale + "级")
                            })
                    })
            })
            .catch(console.error);
    }

    //getWeather();

    let wea = 0;
    $('#upWeather').click(function () {
        // if (wea == 0) {
        //     wea = 1;
        //     let index = setInterval(function () {
        //         wea--;
        //         if (wea == 0) {
        //             clearInterval(index);
        //         }
        //     }, 60000);
        //     getWeather();
        //     iziToast.show({
        //         timeout: 2000,
        //         icon: "fa-solid fa-cloud-sun",
        //         message: '实时天气已更新'
        //     });
        // } else {
        //     iziToast.show({
        //         timeout: 1000,
        //         icon: "fa-solid fa-circle-exclamation",
        //         message: '请稍后再更新哦'
        //     });
        // }
    });

    //获取时间
    let t = null;
    t = setTimeout(time, 1000);

    function time() {
        clearTimeout(t);
        dt = new Date();
        let y = dt.getYear() + 1900;
        let mm = dt.getMonth() + 1;
        let d = dt.getDate();
        let weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
        let day = dt.getDay();
        let h = dt.getHours();
        let m = dt.getMinutes();
        let s = dt.getSeconds();
        if (h < 10) {
            h = "0" + h;
        }
        if (m < 10) {
            m = "0" + m;
        }
        if (s < 10) {
            s = "0" + s;
        }
        $("#time").html(y + "&nbsp;年&nbsp;" + mm + "&nbsp;月&nbsp;" + d + "&nbsp;日&nbsp;" + "<span class='weekday'>" + weekday[day] + "</span><br>" + "<span class='time-text'>" + h + ":" + m + ":" + s + "</span>");
        t = setTimeout(time, 1000);
    }

    //链接提示文字
    $("#social").mouseover(function () {
        $("#social").css({
            "background": "rgb(0 0 0 / 25%)",
            'border-radius': '6px',
            "backdrop-filter": "blur(5px)"
        });
        $("#link-text").css({
            "display": "block",
        });
    }).mouseout(function () {
        $("#social").css({
            "background": "none",
            "border-radius": "6px",
            "backdrop-filter": "none"
        });
        $("#link-text").css({
            "display": "none"
        });
    });

    $("#github").mouseover(function () {
        $("#link-text").html("去 Github 看看");
    }).mouseout(function () {
        $("#link-text").html("通过这里联系我");
    });
    $("#qq").mouseover(function () {
        $("#link-text").html("有什么事吗");
    }).mouseout(function () {
        $("#link-text").html("通过这里联系我");
    });
    $("#email").mouseover(function () {
        $("#link-text").html("来封 Email");
    }).mouseout(function () {
        $("#link-text").html("通过这里联系我");
    });
    $("#bilibili").mouseover(function () {
        $("#link-text").html("来 B 站看看 ~");
    }).mouseout(function () {
        $("#link-text").html("通过这里联系我");
    });
    $("#telegram").mouseover(function () {
        $("#link-text").html("你懂的 ~");
    }).mouseout(function () {
        $("#link-text").html("通过这里联系我");
    });

    //自动变灰
    let myDate = new Date;
    let mon = myDate.getMonth() + 1;
    let date = myDate.getDate();
    let days = ['4.4', '5.12', '7.7', '9.9', '9.18', '12.13'];
    for (let day of days) {
        let d = day.split('.');
        if (mon == d[0] && date == d[1]) {
            document.write(
                '<style>html{-webkit-filter:grayscale(100%);-moz-filter:grayscale(100%);-ms-filter:grayscale(100%);-o-filter:grayscale(100%);filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);_filter:none}</style>'
            );
            $("#change").html("Silence&nbsp;in&nbsp;silence");
            $("#change1").html("今天是中国国家纪念日，全站已切换为黑白模式");
            window.addEventListener('load', function () {
                setTimeout(function () {
                    iziToast.show({
                        timeout: 14000,
                        icon: "fa-solid fa-clock",
                        message: '今天是中国国家纪念日'
                    });
                }, 3800);
            }, false);
        }
    }

    //更多页面切换
    let shoemore = false;
    $('#switchmore').on('click', function () {
        shoemore = !shoemore;
        if (shoemore && $(document).width() >= 990) {
            $('#container').attr('class', 'container mores');
            $("#change").html("<?php echo $config['config'][1]['config'][2]['value'];?>");
            $("#change1").html("<?php echo $config['config'][1]['config'][3]['value'];?>");
        } else {
            $('#container').attr('class', 'container');
            $("#change").html("<?php echo $config['config'][1]['config'][0]['value'];?>");
            $("#change1").html("<?php echo $config['config'][1]['config'][1]['value'];?>");
        }
    });

    //更多页面关闭按钮
    $('#close').on('click', function () {
        $('#switchmore').click();
    });

    //移动端菜单栏切换
    let switchmenu = false;
    $('#switchmenu').on('click', function () {
        switchmenu = !switchmenu;
        if (switchmenu) {
            $('#row').attr('class', 'row menus');
            $("#menu").html("<i class='fa-solid fa-xmark'></i>");
        } else {
            $('#row').attr('class', 'row');
            $("#menu").html("<i class='fa-solid fa-bars'></i>");
        }
    });

    //更多弹窗页面
    $('#openmore').on('click', function () {
        $('#box').css("display", "block");
        $('#row').css("display", "none");
        $('#more').css("cssText", "display:none !important");
    });
    $('#closemore').on('click', function () {
        $('#box').css("display", "none");
        $('#row').css("display", "flex");
        $('#more').css("display", "flex");
    });

    //监听网页宽度
    window.addEventListener('load', function () {
        window.addEventListener('resize', function () {
            //关闭移动端样式
            if (window.innerWidth >= 600) {
                $('#row').attr('class', 'row');
                $("#menu").html("<i class='fa-solid fa-bars'></i>");
                //移除移动端切换功能区
                $('#rightone').attr('class', 'row rightone');
            }

            if (window.innerWidth <= 990) {
                //移动端隐藏更多页面
                $('#container').attr('class', 'container');
                $("#change").html("<?php echo $config['config'][1]['config'][0]['value'];?>");
                $("#change1").html("<?php echo $config['config'][1]['config'][1]['value'];?>");

                //移动端隐藏弹窗页面
                $('#box').css("display", "none");
                $('#row').css("display", "flex");
                $('#more').css("display", "flex");
            }
        })
    })

    //移动端切换功能区
    let changemore = false;
    $('#changemore').on('click', function () {
        changemore = !changemore;
        if (changemore) {
            $('#rightone').attr('class', 'row menus mobile');
        } else {
            $('#rightone').attr('class', 'row menus');
        }
    });

    //更多页面显示关闭按钮
    $("#more").hover(function () {
        $('#close').css("display", "block");
    }, function () {
        $('#close').css("display", "none");
    })

    //屏蔽右键
    document.oncontextmenu = function () {
        iziToast.show({
            timeout: 2000,
            icon: "fa-solid fa-circle-exclamation",
            message: '为了浏览体验，本站禁用右键'
        });
        return false;
    }

    //控制台输出
    //console.clear();
    let styleTitle1 = `
    font-size: 20px;
    font-weight: 600;
    color: rgb(244,167,89);
    `
        let styleTitle2 = `
    font-size:12px;
    color: rgb(244,167,89);
    `
        let styleContent = `
    color: rgb(30,152,255);
    `
        let title1 = '無名の主页'
        let title2 = `
     _____ __  __  _______     ____     __
    |_   _|  \\/  |/ ____\\ \\   / /\\ \\   / /
      | | | \\  / | (___  \\ \\_/ /  \\ \\_/ /
      | | | |\\/| |\\___ \\  \\   /    \\   /
     _| |_| |  | |____) |  | |      | |
    |_____|_|  |_|_____/   |_|      |_|
    `
        let content = `
    版 本 号：3.4
    更新日期：2022-07-24

    主页:  https://www.imsyy.top
    Github:  https://github.com/imsyy/home
    `
        console.log(`%c 此模板 ${content}`, styleTitle1, styleTitle2, styleContent)

</script>
</body>

</html>
